
-- oracle

create table m_user (
  id number(16) primary key,
  username varchar2(64) unique,
  avatar varchar2(255),
  email varchar2(64),
  password varchar2(64),
  status number(2),
  created date,
  last_login date
);

create table m_blog (
  id number(16) primary key,
  user_id number(16) not null,
  title varchar2(255) not null,
  description varchar2(255),
  content clob,
  created date,
  status number(2)
);

create sequence seq_m_user;
create sequence seq_m_blog;
--create sequence seq_m_blog start with 100 increment by 1 cache 20;


--
insert into m_user(id, username, password, status) values(seq_m_user.nextval, 'hello', 'fc5e038d38a57032085441e7fe7010b0', 0);--helloworld
insert into m_blog(id, user_id, title, description, created, status)
  select seq_m_blog.nextval, (select id from m_user where username = 'hello'),
  '从入门到放弃', '', to_date('2021-09-02 18:03:00', 'yyyy-mm-dd hh24:mi:ss'), 0
from dual;
